package guiTest;

import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.border.BevelBorder;
import javax.swing.table.TableCellRenderer;

public class StandardHeaderRenderer extends JLabel implements TableCellRenderer 
{
	boolean down;
	public StandardHeaderRenderer()
	{
		setOpaque(true);
	}
	
	public Component getTableCellRendererComponent(JTable table, Object value,
	     boolean isSelected, boolean hasFocus, int row, int column)
	{
		setBackground(new Color(238, 238, 238));
		setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
		setFont(new Font(Settings.FONT_NAME, Font.PLAIN, 18));
		/*String text = "<html>" +
			"<font face=\"tahoma\" size=\"12\">" + value.toString() + "</font>";
		if(hasFocus)
		{
			text += "<font face=\"times new roman\" size=\"9\">&#9660;</font>";
		}
		
		text += "</html>";*/
		String text = value.toString();
		
		if(column == GUI_Creator.ACTIVE_COLUMN)
		{
			if(GUI_Creator.ACTIVE_CLICKS % 2 == 0)
			{
				text += " \u25B2";
			}
			else
			{
				text += " \u25BC";
			}
		}
		
		setText(text);
				
		return this;
	}
}

